from django.db import models

class User(models.Model):
    u_name = models.CharField(max_length=20)
    u_password = models.CharField(max_length=20)
    u_status = models.BooleanField(blank=False)
    u_email = models.CharField(max_length=50)
    u_activiticode = models.CharField(max_length=32)#(16+16)位激活码
    u_img = models.CharField(max_length=100,default=0) #用户头像

class BrandCategory(models.Model):#商标分类
    b_name = models.CharField(max_length=20)
    b_addTime = models.DateTimeField(default="2020-01-01 00:00:00")
    # b_monthSellFee = models.CharField(max_length=20)#月销售额
    # b_avgFee = models.CharField(max_length=20)#产品平均价格

class PhoneInfo(models.Model):#商品信息
    p_title = models.CharField(max_length=500) #商品标题
    p_brand = models.CharField(max_length=20) #图片品牌
    p_img = models.CharField(max_length=500) #图片相对地址
    p_price = models.CharField(max_length=20) #商品价格
    p_number = models.CharField(max_length=500) #商品编号
    p_href = models.CharField(max_length=300) #商品链接
    p_comment_num = models.IntegerField(default=0) #评论数量
    p_updateTime = models.DateTimeField() #更新时间
    p_store = models.CharField(max_length=50) #所属店铺
    p_plate = models.CharField(max_length=50,default="") #来自平台

class DetailParam(models.Model):#商品参数
    d_number = models.CharField(max_length=500) #商品编号
    d_weight = models.CharField(max_length=50) #商品毛重
    d_cpuType = models.CharField(max_length=100) #CPU型号
    d_ram = models.CharField(max_length=20) #运存
    d_rom = models.CharField(max_length=20) #机身存储
    d_bcamera = models.CharField(max_length=100)#后摄主摄像素
    d_fcamera = models.CharField(max_length=100)#前摄主摄像素
    d_mainScreen = models.CharField(max_length=100) #主屏幕尺寸
    d_resolution = models.CharField(max_length=100) #分辨率
    d_os = models.CharField(max_length=100) #操作系统
    d_plate = models.CharField(max_length=50,default="")  # 来自平台

class PriceRecord(models.Model):
    p_number = models.CharField(max_length=50) #与商品信息表对应
    p_time = models.DateTimeField()
    p_price = models.CharField(max_length=20)

class Collection(models.Model):#我的收藏
    c_name = models.CharField(max_length=200)
    c_img = models.CharField(max_length=500)
    c_price = models.IntegerField(default=0)
    c_uerid = models.IntegerField(default=0)#与用户关联
    c_goodsid = models.IntegerField(default=0)#与商品id关联

class Admin(models.Model):#后台管理员
    a_name = models.CharField(max_length=20)
    a_password = models.CharField(max_length=20)

class History(models.Model):#浏览历史
    h_title = models.CharField(max_length=200) #标题
    h_price = models.IntegerField(default=0)  #价格
    h_img = models.CharField(max_length=500,default="")  #图片
    h_userid = models.CharField(max_length=20)#与用户关联
    h_goodsid = models.IntegerField(default=0)

class PicTest(models.Model):
    pic = models.CharField(max_length=200)

class Comparation(models.Model):
    co_title = models.CharField(max_length=200,default="")  # 标题
    co_price = models.IntegerField(default=0)    # 价格
    co_img = models.CharField(max_length=500)    # 图片
    co_weight = models.CharField(max_length=50,default="") #商品毛重
    co_ram = models.CharField(max_length=20,default="") #运存
    co_rom = models.CharField(max_length=20,default="") #机身存储
    co_bcamera = models.CharField(max_length=100,default="")#后摄主摄像素
    co_fcamera = models.CharField(max_length=100,default="")#前摄主摄像素
    co_mainScreen = models.CharField(max_length=100,default="") #主屏幕尺寸
    co_resolution = models.CharField(max_length=100,default="") #分辨率
    co_comment_num = models.CharField(max_length=10,default="") #评论数
    co_store = models.CharField(max_length=100,default="") #店铺
    co_plate = models.CharField(max_length=50, default="")  #平台
    co_os = models.CharField(max_length=50, default="")  #系统
    co_cpuType = models.CharField(max_length=100, default="")  #系统
    phone_id = models.CharField(max_length=20,default="") #对应手机id
    user_id = models.CharField(max_length=50, default="") #对应用户id

class UserInfo(models.Model):
    ui_gender = models.CharField(max_length=5,default="")
    ui_birthday = models.CharField(max_length=10,default="")
    ui_hobby = models.CharField(max_length=50, default=" ")
    ui_qq = models.CharField(max_length=15, default="")
    ui_wx = models.CharField(max_length=30, default="")
    ui_img = models.CharField(max_length=50, default="")
    user_id = models.IntegerField(default=0)

